<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<head>
  <title>VR910 Configuration Tool</title>
  <meta http-equiv="content-type" content="text/html;charset=UTF-8" />
  <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
  <link href="styles/default.css" rel="stylesheet" type="text/css" />
  
  <script type="text/javascript" src="jsolait/jsolait.js"></script>
  <script type="text/javascript" src="scripts/login.js"></script>
  <script type="text/javascript" src="scripts/common.js"></script>
  
<!--[if (lte IE 6)|(gte IE 8)]>
<style type="text/css">
#outer {height:100%;display:table;}
</style>
<![endif]-->

    <script type="text/javascript">jsolait.baseURI="/jsolait/";</script>
	<script type="text/javascript">
		var serviceURL = "/rpc.cgi";
		var methods = [ "misc.getVersion", "user.logout"];
		var jsonrpc=null;
		try {
			jsonrpc = imprt("jsonrpc");
		} catch(e) {
			alert(e);
		}

		function getVersion() {
			try {
				var service = new jsonrpc.ServiceProxy(serviceURL, methods);
				var str_rsp = service.misc.getVersion( ) ;
				document.getElementById('gv').innerHTML+=str_rsp ;
				return str_rsp ;
			} catch(e) {
                if (e.message != null && e.message == "Login first.") {
                    document.location.href = "login.htm?exp";
                    return;
                }
                document.getElementById('gv').innerHTML+=e ;
            }
            return true ;
		}
			

		function startUpload () {
			document.form1.call1.value = jsonrpc.JSONRPCMethod("a").jsonRequest(1,"misc.fileUpload", {script:"/access_node/firmware/web_upgrade.sh"}) ;
			return 1 ;
		}

		function operationDoneListener( text) {
			innerHTML="";
			if ( text )
			{
				output="";
				if ( text.result )
				{
					innerHTML="Upload complete.<br />Log results:<br /><pre>" + text.result + "</pre>";
				}
				else if ( text.error )
				{
					innerHTML="Upload failed.<br />Log results:<br /><pre>" + text.error + "</pre>";
				}
			}
			document.getElementById('result').innerHTML = innerHTML ;
		}
	</script>


</head>

<body onload="SetPageCommonElements();">



<div id="outer">
    <div id="inner">
        <div id="header"> </div>
        
<!-- START PAGE CONTENT -->

<div id="content">
	<div id="columnA">
		<h2>System Upgrade</h2>

          <form name="form1" action="/rpc.cgi" enctype="multipart/form-data" method="post" target="iFrame">
          <table width="650px" cellpadding="0" cellspacing="0" class="containerDiv" border="0">
		   <tr>
		   	   <td class="windowHeader" colspan="2">Firmware</td>
		   </tr>
		   <tr>
		   	   <td width="25px">&nbsp;</td>
			   <td width="525px" class="labels">
			   	   <div id="gv">Current Firmware version: <script type="text/javascript"> getVersion(); </script> </div><br />
   			   </td>
		   </tr>
		   <tr>
		   	   <td>&nbsp;</td>
			   <td class="labels">
			      Firmware update file &nbsp;......&nbsp; 
 	   	          <input type='hidden' name='call1' id='call1' />
                  <input type='file' name='figure2' value='2' size="55" style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 11px; border: solid 1px #000000;" 
                    onkeydown="return false;" onkeypress="return false;" onkeyup="return false;" />
    		   </td>
		   </tr>
    	   <tr>
            <td class="spacer" colspan="2"></td>
 		   </tr>	   
		   <tr>
            <td colspan="2" align="center">
                 <input type="submit" onclick="javascript:startUpload();" class="button" value="Start" />
            </td>
		   </tr>
        </table>
        </form >
        <div id="result"> </div>
        <iframe src="about:blank" id="iFrame" name="iFrame"  style="display:none; visibility:hidden;"></iframe>

		<p><br /><br /><br /><br /><br /></p>
	</div>
	<div id="columnB"></div>
</div>

<!-- END PAGE CONTENT -->
           
    </div>
</div>


<div id="footer" />

</body>
</html>
